package com.example.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.dto.CoptdDto;
import com.example.entity.dto.CoptdDtos;
import com.example.entity.dto.pc.PCcoptcDto;
import com.example.entity.vo.CoptdFZzVo;
import com.example.entity.vo.CoptdVo;
import com.example.entity.yifei.Coptc;
import com.example.entity.yifei.Coptd;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LiangPandeng
 * @since 2024-02-28
 */
public interface CoptdMapper extends BaseMapper<Coptd> {

    List<Coptd> coptdList(PCcoptcDto dto);

    List<Coptd> getCoptdPlusList(@Param("db") String db, @Param("dh") String dh);

    Integer generateTd003(@Param("td001")String td001, @Param("td002")String td002);

    Double getLatestPrice(@Param("productId")String productId, @Param("customId")String customId);

    Double getTd010Double(@Param("TC004")String TC004,@Param("TD004")String TD004);

    Integer updateUdf03Integer(List<CoptdDto> coptdDots);

    /**
     * 计算单头的 税前金额，税额，数量
     * @param TD001
     * @param TD002
     * @return
     */
    Coptc getSumNums(String TD001, String TD002);

    List<Coptd> queryCopTc(CoptdDtos coptdDtos);

    List<CoptdVo> selectCoptdListSg(CoptdVo coptdVo);

    List<CoptdFZzVo> queryIpageFzz(CoptdFZzVo coptdFZzVo);

    Coptd coptfCoptdPlus(String td007, String td004);

    @DS("erp3_help")
    @Select("SELECT * FROM COPTD")
    List<Coptd> all();

    /**
     * TD001 - TD002 - TD003 得到能确定主键的唯一KEY
     * @return
     */
    List<String> getCoptdKeyList();
}
